package com.chexiehui.jc.mvp.car;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarInfo;
import com.chexiehui.jc.entity.DictInfo;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 二手车
 * @Auth SongJun
 * @Date 2020/05/21 00:18
 **/
public interface CarGarageAssistantCovenant {

    interface View extends BaseView {
//        void onGetHotSeriesListSuccess(BaseModel<BasePage<CarSeriesInfo>> successResult);
//
//        void onGetHotSeriesListFailure(BaseModel<Object> failureResult);

        void onGetListSuccess(BaseModel<BasePage<CarInfo>> successResult);

        void onGetListFailure(BaseModel<Object> failureResult);

        void onGetCraGradeListSuccess(BaseModel<List<DictInfo>> successResult);

        void onGetCraGradeListFailure(BaseModel<Object> failureResult);

        void onGetCountryTypeListSuccess(BaseModel<List<DictInfo>> successResult);

        void onGetCountryTypeListFailure(BaseModel<Object> failureResult);

        String getCityName();
        String getBrandId();
        String getPriceMin();
        String getPriceMax();
        String getCarType();
        String getCarCountry();

    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_CAR_HAND_LIST)
        Observable<BaseModel<BasePage<CarInfo>>> getList(
                @Field("key") String key,
                @Field("city") String city,
                @Field("priceMin") String priceMin,
                @Field("priceMax") String priceMax,
                @Field("country") String country,
                @Field("brandId") String brandId,
                @Field("type") String type,
                @Field("pageIndex") int pageIndex,
                @Field("pageSize") int pageSize);

        @FormUrlEncoded
        @POST(Constants.URL_CAR_GRADE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCraGradeList(@Field("timespan") String timespan);
        @FormUrlEncoded
        @POST(Constants.URL_COUNTRY_TYPE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCountryTypeList(@Field("timespan") String timespan);

//        @FormUrlEncoded
//        @POST(Constants.URL_BRAND_LIST)
//        Observable<BaseModel<List<BrandListInfo>>> getList(@Field("timespan") String timespan);
    }

    interface Presenter {
        void getCraGradeList();
        void getCountryTypeList();
        void getList(int pageNum);
    }

}